if ( !( $e instanceof MWException ) || $e->isLoggable() ) {
$log = self::getLogMessage( $e );
if ( $wgLogExceptionBacktrace ) {
- wfDebugLog( 'exception', $log . "\n" . $e->getTraceAsString() . "\n" );
+ wfDebugLog( 'exception', $log . "\n" . $e->getTraceAsString() );
} else {
wfDebugLog( 'exception', $log );
}
$pipes = null;
$proc = proc_open( $cmd, $desc, $pipes );
if ( !$proc ) {
- wfDebugLog( 'exec', "proc_open() failed: $cmd\n" );
+ wfDebugLog( 'exec', "proc_open() failed: $cmd" );
$retval = -1;
return '';
}
}
if ( $logMsg !== false ) {
- wfDebugLog( 'exec', "$logMsg: $cmd\n" );
+ wfDebugLog( 'exec', "$logMsg: $cmd" );
}
return $outBuffer;
* @param $msg string
*/
protected function log( $msg ) {
- wfDebugLog( 'squid', __CLASS__ . " ($this->host): $msg\n" );
+ wfDebugLog( 'squid', __CLASS__ . " ($this->host): $msg" );
}
}
$ipList = gethostbynamel( $host );
if ( $ipList ) {
- wfDebugLog( 'dnsblacklist', "Hostname $host is {$ipList[0]}, it's a proxy says $base!\n" );
+ wfDebugLog( 'dnsblacklist', "Hostname $host is {$ipList[0]}, it's a proxy says $base!" );
$found = true;
break;
} else {
- wfDebugLog( 'dnsblacklist', "Requested $host, not found in $base.\n" );
+ wfDebugLog( 'dnsblacklist', "Requested $host, not found in $base." );
}
}
}
$this->parserOutput = ParserCache::singleton()->getDirty( $this->page, $this->parserOptions );
if ( $this->parserOutput === false ) {
- wfDebugLog( 'dirty', "dirty missing\n" );
+ wfDebugLog( 'dirty', 'dirty missing' );
wfDebug( __METHOD__ . ": no dirty cache\n" );
return false;
} else {
wfDebug( __METHOD__ . ": sending dirty output\n" );
- wfDebugLog( 'dirty', "dirty output {$this->cacheKey}\n" );
+ wfDebugLog( 'dirty', "dirty output {$this->cacheKey}" );
$this->isDirty = true;
return true;
}
try {
$compiledRules = CLDRPluralRuleEvaluator::compile( $rules );
} catch ( CLDRPluralRuleError $e ) {
- wfDebugLog( 'l10n', $e->getMessage() . "\n" );
+ wfDebugLog( 'l10n', $e->getMessage() );
return array();
}
}
} catch ( RedisException $e ) {
$this->downServers[$server] = time() + self::SERVER_DOWN_TTL;
- wfDebugLog( 'redis', "Redis exception connecting to $server: " . $e->getMessage() . "\n" );
+ wfDebugLog( 'redis', "Redis exception connecting to $server: " . $e->getMessage() );
return false;
}
* @param RedisException $e
*/
public function handleException( $server, RedisConnRef $cref, RedisException $e ) {
- wfDebugLog( 'redis', "Redis exception on server $server: " . $e->getMessage() . "\n" );
+ wfDebugLog( 'redis', "Redis exception on server $server: " . $e->getMessage() );
foreach ( $this->connections[$server] as $key => $connection ) {
if ( $cref->isConnIdentical( $connection['conn'] ) ) {
$this->idlePoolSize -= $connection['free'] ? 1 : 0;
foreach ( $lags as $i => $lag ) {
if ( $i != 0 ) {
if ( $lag === false ) {
- wfDebugLog( 'replication', "Server #$i is not replicating\n" );
+ wfDebugLog( 'replication', "Server #$i is not replicating" );
unset( $loads[$i] );
} elseif ( isset( $this->mServers[$i]['max lag'] ) && $lag > $this->mServers[$i]['max lag'] ) {
- wfDebugLog( 'replication', "Server #$i is excessively lagged ($lag seconds)\n" );
+ wfDebugLog( 'replication', "Server #$i is excessively lagged ($lag seconds)" );
unset( $loads[$i] );
}
}
$i = $this->getRandomNonLagged( $currentLoads, $wiki );
if ( $i === false && count( $currentLoads ) != 0 ) {
# All slaves lagged. Switch to read-only mode
- wfDebugLog( 'replication', "All slaves lagged. Switch to read-only mode\n" );
+ wfDebugLog( 'replication', "All slaves lagged. Switch to read-only mode" );
$wgReadOnly = 'The database has been automatically locked ' .
'while the slave database servers catch up to the master';
$i = ArrayUtils::pickRandom( $currentLoads );
# pickRandom() returned false
# This is permanent and means the configuration or the load monitor
# wants us to return false.
- wfDebugLog( 'connect', __METHOD__ . ": pickRandom() returned false\n" );
+ wfDebugLog( 'connect', __METHOD__ . ": pickRandom() returned false" );
return false;
}
wfDebugLog( 'connect', __METHOD__ .
- ": Using reader #$i: {$this->mServers[$i]['host']}...\n" );
+ ": Using reader #$i: {$this->mServers[$i]['host']}..." );
$conn = $this->openConnection( $i, $wiki );
if ( !$conn ) {
- wfDebugLog( 'connect', __METHOD__ . ": Failed connecting to $i/$wiki\n" );
+ wfDebugLog( 'connect', __METHOD__ . ": Failed connecting to $i/$wiki" );
unset( $nonErrorLoads[$i] );
unset( $currentLoads[$i] );
continue;
# If all servers were down, quit now
if ( !count( $nonErrorLoads ) ) {
- wfDebugLog( 'connect', "All servers down\n" );
+ wfDebugLog( 'connect', "All servers down" );
}
if ( $i !== false ) {
return;
}
- wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) . "\n" );
+ wfDebugLog( 'squid', __METHOD__ . ': ' . implode( ' ', $urlArr ) );
if ( $wgHTCPRouting ) {
self::HTCPPurge( $urlArr );
if ( !$conn ) {
$errstr = socket_strerror( socket_last_error() );
wfDebugLog( 'squid', __METHOD__ .
- ": Error opening UDP socket: $errstr\n" );
+ ": Error opening UDP socket: $errstr" );
wfProfileOut( __METHOD__ );
return;
$conf = self::getRuleForURL( $url, $wgHTCPRouting );
if ( !$conf ) {
wfDebugLog( 'squid', __METHOD__ .
- "No HTCP rule configured for URL {$url} , skipping\n" );
+ "No HTCP rule configured for URL {$url} , skipping" );
continue;
}
$htcpTransID, $htcpSpecifier, 2 );
wfDebugLog( 'squid', __METHOD__ .
- "Purging URL $url via HTCP\n" );
+ "Purging URL $url via HTCP" );
foreach ( $conf as $subconf ) {
socket_sendto( $conn, $htcpPacket, $htcpLen, 0,
$subconf['host'], $subconf['port'] );
$cacheID = ( $itemID === false ) ? "$cluster/$id" : "$cluster/$id/";
if ( isset( $externalBlobCache[$cacheID] ) ) {
wfDebugLog( 'ExternalStoreDB-cache',
- "ExternalStoreDB::fetchBlob cache hit on $cacheID\n" );
+ "ExternalStoreDB::fetchBlob cache hit on $cacheID" );
return $externalBlobCache[$cacheID];
}
wfDebugLog( 'ExternalStoreDB-cache',
- "ExternalStoreDB::fetchBlob cache miss on $cacheID\n" );
+ "ExternalStoreDB::fetchBlob cache miss on $cacheID" );
$dbr = $this->getSlave( $cluster );
$ret = $dbr->selectField( $this->getTable( $dbr ),
'blob_text', array( 'blob_id' => $id ), __METHOD__ );
if ( $ret === false ) {
wfDebugLog( 'ExternalStoreDB',
- "ExternalStoreDB::fetchBlob master fallback on $cacheID\n" );
+ "ExternalStoreDB::fetchBlob master fallback on $cacheID" );
// Try the master
$dbw = $this->getMaster( $cluster );
$ret = $dbw->selectField( $this->getTable( $dbw ),
'blob_text', array( 'blob_id' => $id ), __METHOD__ );
if ( $ret === false ) {
wfDebugLog( 'ExternalStoreDB',
- "ExternalStoreDB::fetchBlob master failed to find $cacheID\n" );
+ "ExternalStoreDB::fetchBlob master failed to find $cacheID" );
}
}
if ( $itemID !== false && $ret !== false ) {
if ( $ids ) {
wfDebugLog( __CLASS__, __METHOD__ .
" master fallback on '$cluster' for: " .
- implode( ',', array_keys( $ids ) ) . "\n" );
+ implode( ',', array_keys( $ids ) ) );
// Try the master
$dbw = $this->getMaster( $cluster );
$res = $dbw->select( $this->getTable( $dbr ),
array( 'blob_id' => array_keys( $ids ) ),
__METHOD__ );
if ( $res === false ) {
- wfDebugLog( __CLASS__, __METHOD__ . " master failed on '$cluster'\n" );
+ wfDebugLog( __CLASS__, __METHOD__ . " master failed on '$cluster'" );
} else {
$this->mergeBatchResult( $ret, $ids, $res );
}
if ( $ids ) {
wfDebugLog( __CLASS__, __METHOD__ .
" master on '$cluster' failed locating items: " .
- implode( ',', array_keys( $ids ) ) . "\n" );
+ implode( ',', array_keys( $ids ) ) );
}
return $ret;
}
if ( $action === true ) {
- wfDebugLog( $this->log, "$class::$fname: accepted: '$in' (type: $type)\n" );
+ wfDebugLog( $this->log, "$class::$fname: accepted: '$in' (type: $type)" );
} elseif ( $action === false ) {
- wfDebugLog( $this->log, "$class::$fname: rejected: '$in' (type: $type)\n" );
+ wfDebugLog( $this->log, "$class::$fname: rejected: '$in' (type: $type)" );
} elseif ( $action === null ) {
- wfDebugLog( $this->log, "$class::$fname: input was: '$in' (type: $type)\n" );
+ wfDebugLog( $this->log, "$class::$fname: input was: '$in' (type: $type)" );
} else {
- wfDebugLog( $this->log, "$class::$fname: $action (type: $type; content: '$in')\n" );
+ wfDebugLog( $this->log, "$class::$fname: $action (type: $type; content: '$in')" );
}
}
}
$class = ucfirst( __CLASS__ );
if ( $io ) {
- wfDebugLog( $this->log, "$class::$fname: begin processing: '{$this->basename}'\n" );
+ wfDebugLog( $this->log, "$class::$fname: begin processing: '{$this->basename}'" );
} else {
- wfDebugLog( $this->log, "$class::$fname: end processing: '{$this->basename}'\n" );
+ wfDebugLog( $this->log, "$class::$fname: end processing: '{$this->basename}'" );
}
}
}
* Log a fatal error
*/
protected function logError( $msg ) {
- wfDebugLog( 'redis', "Redis error: $msg\n" );
+ wfDebugLog( 'redis', "Redis error: $msg" );
}
/**
if ( !$status->isOk() ) {
return $status;
}
- wfDebugLog( 'fileconcatenate', "Combined $i chunks in $tAmount seconds.\n" );
+ wfDebugLog( 'fileconcatenate', "Combined $i chunks in $tAmount seconds." );
// File system path
$this->mTempPath = $tmpPath;
$this->mLocalFile = parent::stashFile( $this->user );
$tAmount = microtime( true ) - $tStart;
$this->mLocalFile->setLocalReference( $tmpFile ); // reuse (e.g. for getImageInfo())
- wfDebugLog( 'fileconcatenate', "Stashed combined file ($i chunks) in $tAmount seconds.\n" );
+ wfDebugLog( 'fileconcatenate', "Stashed combined file ($i chunks) in $tAmount seconds." );
return $status;
}